import java.util.Random;

/*
   买彩票
 */
public class WorkTest120304 {
    public static void main(String[] args) {
        Random r = new Random();
        int[] red = new int[6];
        red[0] = r.nextInt(32) + 1;
        //建立循环随机取球,每取一次便遍历一次
        for (int i = 1; i < red.length; i++) {
            red[i] = r.nextInt(32) + 1;
            for (int j = i - 1; j >= 0; j--) {
                if (red[i] == red[j]) {
                    i--;
                }
            }
        }
        int blue = r.nextInt(16) + 1;
        System.out.print("红球为:");
        for (int i = 0; i < red.length; i++) {
            System.out.print(red[i] + " ");
        }
        System.out.println("蓝球为:" + blue);
    }
}
